package com.cwd.arm.inter.util;

import com.cwd.arm.infrastructure.query.*;
import com.cwd.arm.inter.query.*;
import org.springframework.beans.BeanUtils;

/**
 * Created by yan on 21-12-10.
 */
public class QueryToDaoQueryUtil {

    public static ReceiveNodeDaoQuery toDaoQuery(ReceiveNodeQuery query){
        ReceiveNodeDaoQuery daoQuery = new ReceiveNodeDaoQuery();
        BeanUtils.copyProperties(query,daoQuery);
        return daoQuery;
    }

    public static TaxDaoQuery toDaoQuery(TaxQuery query){
        TaxDaoQuery daoQuery = new TaxDaoQuery();
        BeanUtils.copyProperties(query,daoQuery);
        return daoQuery;
    }

    public static ReceiveRecordDaoQuery toDaoQuery(ReceiveRecordQuery query){
        ReceiveRecordDaoQuery daoQuery = new ReceiveRecordDaoQuery();
        BeanUtils.copyProperties(query,daoQuery);
        return daoQuery;
    }

    public static ProjectDaoQuery toDaoQuery(ProjectQuery query){
        ProjectDaoQuery daoQuery = new ProjectDaoQuery();
        BeanUtils.copyProperties(query,daoQuery);
        return daoQuery;
    }

    public static UserDaoQuery toDaoQuery(UserQuery query){
        UserDaoQuery daoQuery = new UserDaoQuery();
        BeanUtils.copyProperties(query,daoQuery);
        return daoQuery;
    }

    public static RoleDaoQuery toRoleQuery(RoleQuery query){
        RoleDaoQuery daoQuery = new RoleDaoQuery();
        BeanUtils.copyProperties(query,daoQuery);
        return daoQuery;
    }
}
